package com.example.demo.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.Order;
import com.example.demo.entity.Order2;
import com.example.demo.entity.Commdity;
import com.example.demo.entity.Shop;
import com.example.demo.entity.User;
import com.example.demo.mapper.CommdityMapper;
import com.example.demo.mapper.OrderMapper;
import com.example.demo.mapper.OrdersMapper;
import com.example.demo.mapper.UserMapper;
import com.example.demo.service.OrdersService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class OrdersImpl extends ServiceImpl<OrdersMapper, Order2> implements OrdersService{

    @Resource
    public OrdersMapper OrdersMapper;
    @Resource
    public OrderMapper OrderMapper;
    public List<Order2> getListall() {
        return OrdersMapper.findall();
    }

    public List<Order2> getrelaidList(int relaid) {
        return OrdersMapper.findgoods_Byrelaid(relaid);
    }

    public boolean modify1(int numid,int relaid){
        OrdersMapper.modify1(numid);
        if(OrdersMapper.panduanorder(relaid).size()==0)OrderMapper.modify(relaid);
        return true;
    }
    public List<Order2> getmodify(int numid,int relaid) {
        return OrdersMapper.modify12(numid,relaid);
    }
    public List<Order2> getmodify3(int numid,int relaid) {
        return OrdersMapper.modify13(numid,relaid);
    }
    public List<Order2> getmodify4(int numid,int relaid) {
        return OrdersMapper.modify14(numid,relaid);
    }
}
